package com.jsyh.maidu.adapter.home;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.jsyh.maidu.R;
import com.jsyh.maidu.adapter.HomeSaleAdapter;
import com.jsyh.maidu.config.ConfigValue;
import com.jsyh.maidu.model.Cuxiao;
import com.jsyh.maidu.views.BetterRecyclerView;
import com.squareup.picasso.Picasso;

import java.util.List;


/**
 * Created by Administrator on 2017/6/8.
 */

public class BrandHolder extends MyBaseViewHolder {
    private BetterRecyclerView bestList;
    private HomeSaleAdapter adapter;

    private ImageView ad5;
    private TextView type;

    public BrandHolder(View itemView, String url, List<Cuxiao> datas, Context context) {
        super(itemView);

        type = (TextView) itemView.findViewById(R.id.tv_type);
        type.setText("天天特价");
        ad5 = (ImageView) itemView.findViewById(R.id.news_img);
        if (datas.size() > 0) {
            Picasso.with(context).load(ConfigValue.IMG_IP + url).into(ad5);
            adapter = new HomeSaleAdapter(datas, context);
            bestList = (BetterRecyclerView) itemView.findViewById(R.id.news_list);
            LinearLayoutManager layoutManager = new LinearLayoutManager(context);
            layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
            bestList.setLayoutManager(layoutManager);
            bestList.setAdapter(adapter);
        }


    }

    @Override
    public void bindData() {


    }


}
